<template>
	<view class="title-view just-between">
		<text class="title-text">{{ scope?.pickTaskNo }}</text>
		<text style="margin-left: 15rpx;font-size: 30rpx;color: orange; font-weight: 600;"
			v-if="(formatDuringText && scope.pickTaskStatus != '2')">{{ (isGreaterThanCurTime ? '拣货剩余 ' : '拣货超时 ')
			+ formatDuringText }}</text>
	</view>
	<eui-text v-model="scope.areaCode" type="titlename" :name="scope.areaName" title="区域" style="width: 100%;"
		v-if="scope?.areaCode" />
	<eui-text :value="scope.areaName" type="name2" title="区域" style="width: 100%;" v-else />
	<eui-text :value="scope.expectDeliveryStartTime" type="rdstime2" title="最早配送时间" style="width: 100%;" />
	<eui-text :value="scope.expectDeliveryEndTime" type="rdstime2" title="最晚配送时间" style="width: 100%;" />
	<view style="font-size: 14px;color: #888;">涉及订单<text class="bold co-00">{{ scope.orderNum }}个 </text>商品<text
			class="bold co-00">{{ scope.goodsNum }}件 </text>重量<text class="bold co-00"> {{ scope.goodsWeight }}kg</text>
	</view>
</template>

<script setup lang="ts">
import { greaterThanCurTime, getDiffTime } from '../../../../hooks/useDatetimeUtil'
import { computed, defineProps } from 'vue';

const props = defineProps<{
	scope?: any;
	currentTime?: any;
}>()

const formatDuringText = computed(() => {
	if (!!props.scope.expectPickupTime) {
		return getDiffTime(new Date(props.scope.expectPickupTime.replace(/-/g, "/")));
	}
})

const isGreaterThanCurTime = computed(() => {
	if (!!props.scope.expectPickupTime) {
		return greaterThanCurTime(new Date(props.scope.expectPickupTime.replace(/-/g, "/")));
	}
})



</script>
<style lang="scss" scoped>
@import "../../common/common.css";

.popup-content {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 0;
	background-color: #fff;

	.popup-title {
		display: flex;
		align-items: center;
		box-sizing: border-box;
		width: 100%;
		height: 100rpx;
		padding-right: 36rpx;
		padding-left: 30rpx;
		font-size: 33rpx;
		line-height: 100rpx;
		border-bottom: 1rpx solid #f1f1f1;
	}
}

.bottom-1 {
	display: flex;
	justify-content: center;
	flex: 0 0 auto;
	height: 70rpx;
}


.title-view {
	display: flex;
	flex-direction: row;
	align-items: center;
	width: 100%;
	height: 46rpx;
	margin-bottom: 24rpx;
}

.title-text {
	margin-top: 0;
	font-size: 32rpx;
	font-style: normal;
	font-weight: 600;

	//   color: $uni-text-color-primary;
	line-height: 45rpx;
	text-align: left;
}
</style>